6.8 Panels (panel)
1. Definition
Panels are windows used for displaying text messages and updating the
values of variables. A panel P consists of a set of panel items and a set
of buttons. With each item (except of text items) is associated a variable of
a certain type (int, bool, string, double, color) whose value can be
manipulated through the item and a string label.
2. Creation
P (string h)
creates an empty panel P with header h.
3. Operations
&truecm &truecm &
void text_item string s
adds a text_item s to P.
void bool_item string s, bool& x
adds a boolean item with label s and variable x to P.
void real_item string s, doubel& x
adds a real item with label s and variable x to P.
void color_item string s, color& x
adds a color item with label s and variable x to P.
void int_item string s, int& x
adds an integer item with label s and variable x to P.
void int_item string s, int& x, int min, int max
adds an integer slider item with label s, variable x, and
range min,...,max to P.
void int_item string s, int& x, int low, int high, int step
adds an integer choice item with label s, variable x,
range low,..., high, and step size step to P.
void string_item string s, string& x
adds a string item with label s and variable x to P.
void string_item string s, string& x,liststring L
adds a string item with label s, variable x, and menu L
to P.
void choice_item string s, int& x, liststring L
adds an integer item with label s, variable x, and choices
from L to P
void choice_item string s, int& x, string s_1, string s_2, ..., s_k
adds an integer item with label s, variable x, and choices
s1, ..., sk to P (k≤5)
int button string s
adds a button with label s to P and returns its number
void new_button_line
starts a new line of buttons
int open
P is displayed on the screen until a button of P is
selected. Returns the number of the button.